package V001_NewStart;

import java.awt.event.KeyEvent;
import java.awt.event.KeyListener;

/**
 *
 * @author Smai
 */
public class ActionListener implements KeyListener {

  public boolean arrowUp;
  public boolean arrowDown;
  public boolean arrowLeft;
  public boolean arrowRight;

  @Override
  public void keyTyped(KeyEvent e) {
  }

  @Override
  public void keyPressed(KeyEvent e) {
    switch (e.getKeyCode()) {
      case KeyEvent.VK_UP:
        arrowUp = true;
        break;

      case KeyEvent.VK_DOWN:
        arrowDown = true;
        break;

      case KeyEvent.VK_LEFT:
        arrowLeft = true;
        break;

      case KeyEvent.VK_RIGHT:
        arrowRight = true;
        break;

      default:
        break;
    }
  }

  @Override
  public void keyReleased(KeyEvent e) {
//    switch (e.getKeyCode()) {
//      case KeyEvent.VK_UP:
//        arrowUp = false;
//        break;
//
//      case KeyEvent.VK_DOWN:
//        arrowDown = false;
//        break;
//
//      case KeyEvent.VK_LEFT:
//        arrowLeft = false;
//        break;
//
//      case KeyEvent.VK_RIGHT:
//        arrowRight = false;
//        break;
//
//      default:
//        break;
//    }
  }
}
